
clear

cd "C:\code"

import delimited datasetdiff.txt, delimiters(tab) clear

*label variables
label variable deaths_per_capita "Deaths Per Capita"
*label variable weekly_incr_deaths_per_capita "Weekly Change in Deaths Per Capita"
label variable stayhome "Stay at Home"
label variable emergency "State of Emergency"
label variable nursingmustaccept "Nursing Accept Pos."
label variable novisit "No Nursing Visits"
*label variable schoolshut "Schools Closed"
label variable employeemask "Employees Masks"
label variable maskrec "Masks Recommended"
label variable maskmandatory "Mandatory Masks"
label variable parksclosed "Beaches or Parks Closed"
label variable openreverse "Re-openings Reversed"
label variable noelective "No Elective Procedures"
label variable restclosed "Restaurants Closed"
label variable barsclosed "Bars Closed"
label variable gymsclosed "Gyms Closed"
label variable spasclosed "Spas Closed"
label variable gathermax10 "Gatherings Limited to 10"
label variable gathermax100 "No Gatherings Over 100"
label variable gathermax100plus "No Gatherings Limit>100"
label variable medriskclose "Med. Risk Bus. Closed"
label variable highriskclose "High Risk Bus. Closed"
label variable higherriskclose "Higher Risk Bus. Closed"
label variable highestriskclose "Highest Risk Bus. Closed"
label variable percapincome "Per Capita Income"
label variable popdensity "Population Density"
label variable obese "Obesity"
label variable smoke "Smokers"
label variable housingdensity "Housing Density"
label variable t_first "Days Since First Case"
label variable deaths7_growth "Growth{\sub t+1}"
label variable deaths14_growth "Growth{\sub t+2}"
label variable deaths21_growth "Growth{\sub t+3}"
label variable deaths28_growth "Growth{\sub t+4}"
label variable deaths35_growth "Growth{\sub t+5}"
label variable deaths42_growth "Growth{\sub t+6}"
label variable deaths7_lgrowth "Growth{\sub t-1}"
label variable deaths14_lgrowth "Growth{\sub t-2}"
label variable deaths21_lgrowth "Growth{\sub t-3}"
label variable deaths28_lgrowth "Growth{\sub t-4}"
label variable deaths35_lgrowth "Growth{\sub t-5}"
label variable deaths42_lgrowth "Growth{\sub t-6}"
label variable deaths7_per_cap_lag "Deaths Per Cap{\sub t-1}"
label variable deaths14_per_cap_lag "Deaths Per Cap{\sub t-2}"
label variable deaths21_per_cap_lag "Deaths Per Cap{\sub t-3}"
label variable deaths28_per_cap_lag "Deaths Per Cap{\sub t-4}"
label variable deaths35_per_cap_lag "Deaths Per Cap{\sub t-5}"
label variable deaths42_per_cap_lag "Deaths Per Cap{\sub t-6}"
label variable t "Days Since March 1"
label variable avgtemp "Avg Temperature"
label variable hothumidweekdays "Hot Humid Weekdays"
label variable nursetotpop "Nursing Home Pop."
label variable hothumidweekend "Hot Humid Weekend"
label variable coldweekday "Cold Weekdays"
label variable coldweekend "Cold Weekend"
label variable age65plus "Age 65+"
label variable age85plus "Age 85+"
label variable asian "Asian"
label variable black "Black"
label variable hispanic "Hispanic"
label variable nativeamer "Native Americans"
label variable other "Other"

gen date1 = date(date, "DM20Y") 
format date1 %td
drop if date1 > mdy(12,31,2020)
drop if date1 < mdy(3,1,2020)

drop if missing(deaths42_lgrowth)

*table A.1 (main) 
reg deaths7_growth deaths_per_capita deaths7_lgrowth deaths14_lgrowth deaths21_lgrowth deaths28_lgrowth deaths35_lgrowth deaths42_lgrowth t_first t avgtemp hothumidweekdays hothumidweekend coldweekday coldweekend age65plus age85plus asian black hispanic nativeamer other percapincome popdensity diabetes obese smoke housingdensity nursetotpop stayhome emergency nursingmustaccept novisit  employeemask  maskrec maskmandatory parksclosed openreverse noelective restclosed barsclosed gymsclosed spasclosed  gathermax10 gathermax100 gathermax100plus medriskclose highriskclose higherriskclose highestriskclose log_wks_stayhome log_wks_emergency  log_wks_nursingmustaccept log_wks_novisit log_wks_employeemask log_wks_maskrec log_wks_maskmandatory log_wks_parksclosed log_wks_openreverse log_wks_noelective log_wks_restclosed log_wks_barsclosed log_wks_gymsclosed log_wks_spasclosed log_wks_gathermax10 log_wks_gathermax100 log_wks_gathermax100plus log_wks_medriskclose log_wks_highriskclose log_wks_higherriskclose log_wks_highestriskclose wks_stayhome wks_emergency wks_nursingmustaccept wks_novisit wks_employeemask wks_maskrec wks_maskmandatory wks_parksclosed wks_openreverse wks_noelective wks_restclosed wks_barsclosed wks_gymsclosed wks_spasclosed wks_gathermax10 wks_gathermax100 wks_gathermax100plus wks_medriskclose wks_highriskclose wks_higherriskclose wks_highestriskclose, vce(cluster countyfips) 

outreg2 using "C:\code\output\tableA1.doc", replace stats(coef se) drop(deaths7_growth deaths14_growth deaths28_growth deaths42_growth deaths21_growth deaths35_growth) adjr2 dec(3) label nonotes title(Table A1) sideway noparen 